package components.intertitles;

import java.awt.BasicStroke;
import java.awt.Color;
import java.awt.Font;
import java.awt.GradientPaint;
import java.awt.RenderingHints;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.awt.event.MouseMotionAdapter;
import java.awt.geom.Point2D;
import java.util.EventObject;
import java.util.Vector;

import menus.common.AbstractMenu;
import menus.demm.DEMM;
import menus.flower.FlowerMenu;
import menus.zone.ZoneMenu;

import components.SetupExperiment;
import components.factors.Technique.TechniqueInterface;

import fr.inria.insitu.noe.Platform;
import fr.inria.insitu.noe.exp.model.Experiment;
import fr.inria.insitu.noe.exp.model.Intertitle;
import fr.lri.swingstates.canvas.CEllipse;
import fr.lri.swingstates.canvas.CPolyLine;
import fr.lri.swingstates.canvas.CRectangle;
import fr.lri.swingstates.canvas.CText;
import fr.lri.swingstates.canvas.Canvas;
import fr.lri.swingstates.gestures.Gesture;

/**
 * @author mathieu
 *  
 * @touchstone.intertitle TrialInstructions
 *
 */

public class TrialInstructions extends Intertitle {

	public static final String InstructionTag = "InstructionsTrial";
	public static final String ZoneInstructionsTag = "Zone Instructions Tag";
	
	public static final int ZONE_WIDTH = 350;

	public static Font font = new Font("verdana", Font.PLAIN, 36);

	protected Canvas canvas;
	protected CRectangle instructionZone;
	
	protected static int maxDimension, minDimension;

	public TrialInstructions() {
		
		super();
		
		canvas = ((SetupExperiment)Platform.getExperiment().getSetUp()).getGestureArea();
		
		maxDimension = Math.max(canvas.getBounds().width, canvas.getBounds().height);
		minDimension = Math.min(canvas.getBounds().width, canvas.getBounds().height);
		
	}

	public void beginIntertitle() {
		
		canvas.requestFocus();
		
		instructionZone = (CRectangle)canvas.newRectangle(new Point2D.Double(0, 0), ZONE_WIDTH, canvas.getHeight())
											.setOutlined(false)
											.setFilled(true)
											.setFillPaint(Color.LIGHT_GRAY)
											
											.addTag(ZoneInstructionsTag)
											
											.setPickable(false)
											.setDrawable(true);
		
		Platform.getInstance().repaint();
		
	}		

	public void endIntertitle() {
	}

}
